Learn R Programming

cubfits (version 0.1-2)

Simulation Tool: Simulate ORFs and Expression Data

Description

These utility functions generate data for simulation studies including fake ORFs and expression values.

Usage

simu.orf(n, b.Init, phi.Obs = NULL, AA.prob = NULL, orf.length = NULL, orf.names = NULL, model = .CF.CT$model) simu.phi.Obs(Phi, sigmaW.lim = 1, bias.Phi = 0) simu.mixnormerr(n, param)

Arguments

n
number of ORFs or sequences.
b.Init
parameters of mutation and selection of format b.
phi.Obs
an object of format phi.Obs.
AA.prob
proportion of amino acids.
orf.length
lengths of ORFs.
orf.names
names of ORFs.
model
model to be simulated.
Phi
expression values (potentially true expression).
sigmaW.lim
std of measurement errors (between Phi and phi.Obs).
bias.Phi
bias (in log scale) for observed phi.
param
as in dmixnormerr()

Value

simu.orf() returns a list of format seq.data.simu.phi.Obs() returns a vector of format phi.Obs.simu.mixnormerr() returns a list contains three vectors of length n: one for expected gene expression Phi, one for observed gene expression phi.Obs, and one for the component id id.K.

Details

simu.orf() generates ORFs or sequences based on the b.Init and phi.Obs.

If phi.Obs is omitted, then standard log normal random variables are instead).

If AA.prob is omitted, then uniform proportion is assigned.

If orf.length is omitted, then 10 to 20 codons are randomly assigned.

If orf.names is omitted, then "ORF1" to "ORFn" are assigned.

simu.phi.Obs() generates phi.Obs by adding normal random errors to Phi, and errors have mean 0 and standard deviation sigmaW.lim.

simu.mixnormerr() generates Phi according to the param, and adds normal random errors to Phi.

References

https://github.com/snoweye/cubfits/

See Also

read.seq(), read.phi.df(), write.seq(), write.phi.df(), and mixnormerr.optim().

Examples

Run this code
## Not run: 
# suppressMessages(library(cubfits, quietly = TRUE))
# set.seed(1234)
# 
# # Generate sequences.
# da.roc <- simu.orf(length(ex.train$phi.Obs), b.Init$roc,
#                    phi.Obs = ex.train$phi.Obs, model = "roc")
# names(da.roc) <- names(ex.train$phi.Obs)
# write.fasta(da.roc, names(da.roc), "toy_roc.fasta")
# ## End(Not run)

Run the code above in your browser using DataLab